#include<stdio.h>
#include<string.h>
int vowelStrings(char** words, int wordsSize, int left, int right) {  
    int ret = 0;  
    for (int i = left; i < right; i++) {  
        int len = strlen(words[i]);  
        if(len == 1 && // 确保单词至少有两个字符  
            (words[i][0] == 'a' || words[i][0] == 'e' || words[i][0] == 'i' ||  
             words[i][0] == 'o' || words[i][0] == 'u')){
                ret++;
        }
        else if (len >= 2 &&  // 确保单词至少有两个字符  
            (words[i][0] == 'a' || words[i][0] == 'e' || words[i][0] == 'i' ||  
             words[i][0] == 'o' || words[i][0] == 'u') &&  
            (words[i][len - 1] == 'a' || words[i][len - 1] == 'e' ||  
             words[i][len - 1] == 'i' || words[i][len - 1] == 'o' ||  
             words[i][len - 1] == 'u'))  
        {  
            ret++;  
        }  
    }  
    return ret;  
}
// int main(){
//     char** a = {"are","amy","u"};
//     int left = 0, right = 2;
//     int result = vowelStrings(a, 3, left, right);
//     printf("%d", result);


//     return 0;
// }
int main(){  
    char* a[] = {strdup("are"), strdup("amy"), strdup("u")};  
    int left = 0, right = 3; // 注意，right 应该是 3，因为数组有 3 个元素  
    int result = vowelStrings(a, 3, left, right);  
    printf("%d\n", result); // 输出 3，因为所有字符串都符合条件  
  
    // 释放之前分配的内存  
    for (int i = 0; i < 3; i++) {  
        free(a[i]);  
    }  
  
    return 0;  
}